import { ILevel, ITile } from "../Levels";
import Singleton from "../Base/Singleton";
import { TileManager } from "../Scripts/TIle/TileManager";
import { PlayerManager } from "../Scripts/Player/PlayerManager";
import { WoodenSkeletonManager } from "../Scripts/WoodenSkeleton/WoodenSkeletonManager";
import { DoorManager } from "../Scripts/Door/DoorManager";
import { EnemyManager } from "../Base/EnemyManager";
import { BurstManager } from "../Scripts/Burst/BurstManager";
import { SpikesManager } from "../Scripts/Spikes/SpikesManager";
import { SmokeManager } from "../Scripts/Smoke/SmokeManager";

export type IRecord = Omit<ILevel, 'mapInfo'>

export class DataManager extends Singleton {

    static get Instance() {
        return super.GetInstance<DataManager>();
    }
    mapInfo: Array<Array<ITile>>;
    tileInfo: Array<Array<TileManager>>;
    mapRowCount: number = 0;
    mpaColumnCount: number = 0;
    levelIndex: number = 1;
    player: PlayerManager;
    door: DoorManager;
    enemies: EnemyManager[];
    bursts: BurstManager[];
    spikes: SpikesManager[];
    smokes: SmokeManager[];
    records: IRecord[]

    reset() {
        this.mapInfo = [];
        this.tileInfo = [];
        this.enemies = [];
        this.bursts = [];
        this.spikes = [];
        this.smokes = [];
        this.records = [];
        this.player = null;
        this.door = null;
        this.mapRowCount = 0;
        this.mpaColumnCount = 0;
    }
}


